﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addProduct.aspx.cs" Inherits="Admin_addProduct"  ValidateRequest="false"%>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/common.js"></script>
    <script type="text/javascript" src="imgs/GetAjax.js"></script>
</head>
<body onload='$("#loading").hide()'>
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div>   
<div class="container" id="cpcontainer">
<form name="addform" id="addformAjax"  method="post"  >
<table class="tb">
<tr class="thead">
    <th colspan="2">
        添加产品数据(<font color='red'>＊</font>为必填,其它选填)<span style="color: #ff0000">建议：根据产品类型（唯一）生成存放地址后，相关介绍里面的图片，文件，FLASH等等都可以统一管理。</span>
    </th>
</tr>
<tr id="createDir">
<td style="width: 70px; height: 31px;" align="right" colspan="" rowspan="">
        产品型号：</td>
<td style="text-align:left">
    <input id="txt_pModel" name="txt_pModel" value="" type="text" />   
    <input value="生成图片存放地址" type="button" class="btn"  onclick="createDir()"/>
    &nbsp; &nbsp; &nbsp;&nbsp; <font color="red">注意：当你重新生成文件夹以后，需要重新上传相关数据！</font></td>
</tr>
<tbody id="mainContent" style="display:none">
<tr>
	  <td align="right" style="width: 70px; height: 31px;">名称：</td>
	  <td style="height: 31px"><input id="m_nameAjax" name="m_name" size="23" autocomplete="off"  value=""  />&nbsp;<font color='red'>＊</font><span id="m_name_ok"></span>类 型：<%=ProductClassDp("m_type")%>	</td>
</tr>
<tr>        
    <td height="22" align="right" style="width: 70px">
        上传图片：&nbsp;</td>
    <td>        
        <input name="dirName" readonly="readonly" id="dirName" type="text" size="30" value="" style="background-color: gainsboro">&nbsp;&nbsp;<input
            id="Button1" type="button" class="btn" value="重新生成存放地址" onclick="canelDir()" />&nbsp;&nbsp;
        <input id="content" type="hidden"  name="imgSrc"/><iframe src="FileDownLoad/ZrNet_upload.htm" scrolling="no" topmargin="0" width="300" height="24" marginwidth="0" marginheight="0" frameborder="0" align="center"></iframe>
        <span style="color: #ff0000">支持图片类型gif|jpg|bmp|png，大小5M以下（by 周睿）</span>
    </td>   
</tr>
<tr>
  <td align="right" style="height: 31px; width: 70px;">别名：</td>
  <td style="height: 31px"><input type="text" id="keywordAjax"  name="tag" size="30" />  用空格隔开</td>
</tr>
<tr>
    <td align="right" style="height: 31px; width: 70px;">  &nbsp;&nbsp;点击率：</td>
    <td style="height: 31px"><input type="text" name="view" id="m_hitAjax" maxlength="9"  value=0  onblur='checkInput(this.value,"num")'/></td>
</tr>
<tr>
    <td align="right" style="height: 31px; width: 70px;"> 排序：</td>
    <td style="height: 31px"><input id="Text1" type="text" name="psort" value="1" /></td>
</tr>
<tr><td colspan='2' style="height: 27px">&nbsp;<img src='imgs/btn_add.gif' class='pointer' align='absmiddle' onclick="$('#seo').stop().toggle()"/>&nbsp;&nbsp;<font color="red">产品优化设置(包括头部,关键字,描述,底部)</font></td></tr>
<tr><td colspan='2' id="seotd">
	<table id="seo" width="100%" style="display:none;">
    <tr>
        <td align="right" style="height: 56px;width:70px">
            页面标题：</td>
        <td style="height: 56px">
            <textarea id="TextArea1" name="title" style="width: 490px; height: 69px">例如:XXXXX产品-xxx公司名称</textarea></td>
    </tr>
    <tr>
        <td align="right" style="height: 56px;width:70px">
            关键字：<td style="height: 56px">
            <textarea id="Textarea2" name="key" style="width: 490px; height: 69px">例如:关键字A 关键字B 关键字C 关键字D 关键字E 最后是5个,(过多的关键字会导致惩罚)</textarea></td>
    </tr>
    <tr>
        <td align="right" style="height: 56px;width:70px">
            页面描述：</td>
        <td style="height: 56px">
            <textarea id="Textarea3" name="des" style="width: 490px; height: 69px">例如:优网公司专门从事企业网站建设,优化,整合服务一体的的外包公司,提供最专业,最稳定,及最实惠的服务(简短不超过100中文字个描述)</textarea></td>
    </tr>
    <tr>
        <td align="right" style="height: 56px;width:70px">
            底部描述：</td>
        <td style="height: 56px">
            <textarea id="Textarea4"  name="up" style="width: 490px; height: 69px">例如:XXX产品 XXX产品1 XX产品2等等</textarea></td>
    </tr>
    </table>
  </td>
</tr>
<tr>
  <td align="right" height="22" style="width: 70px"></td>
  <td>
      说明:尽量把产品填写完整，这样能更好的被搜索引擎收录</td>
</tr>
<tr>
  <td align="right" height="22" style="width: 70px">相关介绍：</td>
   <td>
       <fckeditorv2:fckeditor id="FCKeditor1" runat="server" height="300px" toolbarset="Zrnet" width="650px" ></fckeditorv2:fckeditor>
       </td>
</tr>
<tr>
   <td style="height: 27px; width: 70px;"></td> <td class="forumRow" style="height: 27px" ><input type="button" class="btn" value="确认保存" name="Submit" id="tijiao"  />&nbsp;<input type="reset" class="btn" value="清 除"  onclick="resetCon('FCKeditor1')">&nbsp;<input type=button class="btn" value="返　回" onClick="javascript:location.href='adminProduct.aspx';"/>
   </td>
</tr>
</tbody>
</table>
<uc1:adminfoot ID="Adminfoot1" runat="server" />
</form>  
</div>   
<script type="text/javascript">
function resetCon(source) {
    //document.addform.reset();
    var oEditor=FCKeditorAPI.GetInstance(source).EditorDocument.body.innerHTML="";
    return false;
}
</script>
<script type="text/javascript">
$(document).ready(function(){
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url:       "?state=insert",         // override for form's 'action' attribute 
       // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: false,        // clear all form fields after successful submit 
        resetForm: false        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){       
            $("#loading").show();    
            var oEditor = FCKeditorAPI.GetInstance("FCKeditor1") ;   
            oEditor.UpdateLinkedField(); 
            $('#addformAjax').ajaxSubmit(options);
            return false;            
    });
})
function showResponse(msg){ 
    if(msg=="1")
    {
        alert("添加成功!!!");
        location.href=location.href;
    }
    else
    {
        alert(msg);       
    }
} 
function showRequest(formData, jqForm, options)
 { 
           
	
    return true; 
} 
</script>
<script type="text/javascript">
function createDir()
{
    $("#loading").show();
    var url="";
    url=convertURL("addProduct.aspx?state=create&dirName="+escape($("#txt_pModel").attr("value")));
    ajax_get(url,'',function(msg)
    {
        if(msg==1) 
        {
            alert("生成成功！")
            $("#mainContent").show();            
            $("#dirName").attr("value",$("#txt_pModel").attr("value"));
            $("#createDir").hide();
        }
        else
        {
            alert(msg);
        }      
        $("#loading").hide();
    });
}
function canelDir()
{
//      location.href=location.href;
    $("#loading").show();
    var url="";
    url=convertURL("addProduct.aspx?state=canel&dirName="+escape($("#dirName").attr("value")));
    ajax_get(url,'',function(msg)
    {
        if(msg==1) 
        {
             resetCon("FCKeditor1");
             $('#mainContent').hide();
             $('#createDir').show();          
        }         
        $("#loading").hide();
    });
}
</script>
</body>
</html>
